package api

import (
	"github.com/gin-gonic/gin"
	"topic-chat/api/handler"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
		}

		order := api.Group("/order")
		{
			order.POST("add", handler.AddOrder)
			order.GET("show", handler.ShowOrder)
			order.GET("listByGm", handler.ListByGmOrder)
			order.GET("listByUser", handler.ListByUserOrder)
		}
	}

}
